home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c,comp.unix.programmer
- Path: Utrecht.NL.net!news
- From: Rene Pijlman <R.W.Pijlman@inter.nl.net>
- Subject: Re: tcp/ip woes.
- X-Nntp-Posting-Host: asp98-0.amsterdam.nl.net
- Message-ID: <DpILL7.Ks1@inter.NL.net>
- Sender: news@inter.NL.net (News at newsutr)
- Reply-To: R.W.Pijlman@inter.nl.net
- Organization: the arrangement of parts so as to form an effective whole
- X-Newsreader: skim 0.8.4
- References: <4k94gs$nm0@madeline.INS.CWRU.Edu>
- Date: Sun, 7 Apr 1996 23:09:45 GMT
-
- lem@po.CWRU.Edu (Leonard E. Marinis) wrote:
- >.. this is the piece of code that giving me headaches -
- >
- > /* check it out & process if ICMP_ECHOREPLY */
- > mp=(struct icmphdr *)buff+20;
- > if(!mp->type) {
- > from_host=inet_ntoa(from.sin_addr);
- > host_info=gethostbyaddr((char *)&from.sin_addr, sizeof(from.sin_addr), AF_INET);
- > printf("\nreply from %s\t", from_host);
- > if(strlen(from_host) < 13)
- > printf("\t");
- > printf("[%s]", host_info->h_name);
- >
- > } else
- > printf("\nnon ICMP_ECHOREPLY packet");
- >
- >the strange thing is, it works fine. until about 80 host replies
- >come in - at which time the process segmentation faults
- >and quits. if i had any clue about how to analyze a core file, i would.
-
- gethostbyaddr() returns NULL on error.
-
- HTH,
- --
- Rene Pijlman
- R.W.Pijlman@inter.nl.net http://www.inter.nl.net/users/R.W.Pijlman
-